<%@page import="com.kaishengit.entity.Todo"%>
<%@page import="com.kaishengit.dao.TodoDao"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String id = request.getParameter("id");
	
	try {
		Todo todo = new TodoDao().findById(Integer.parseInt(id));
		if(todo == null) {
			response.sendRedirect("list.jsp");
			return;
		}
		request.setAttribute("todo", todo);
		request.getRequestDispatcher("show.jsp").forward(request,response);
	} catch(Exception e) {
		response.sendRedirect("list.jsp");
		return;
	}

%>
